Stored Procedures [dbo].[dt_getobjwithprop]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@propertyvarchar(30)30
@valuevarchar(255)255
Permissions
TypeActionOwning Principal
GrantExecutepublic
SQL Script
/*
**    Retrieve the owner object(s) of a given property
*/

create procedure dbo.dt_getobjwithprop
    @property varchar(30),
    @value varchar(255)
as
    set nocount on

    if (@property is null) or (@property = '')
    begin
        raiserror('Must specify a property name.',-1,-1)
        return (1)
    end

    if (@value is null)
        select objectid id from dbo.dtproperties
            where property=@property

    else
        select objectid id from dbo.dtproperties
            where property=@property and value=@value
GO
GRANT EXECUTE ON  [dbo].[dt_getobjwithprop] TO [public]
GO
Uses